gdkvulkancontext-win32.c: Implement ->begin_frame()
authorChun-wei Fan <fanchunwei@src.gnome.org>
Mon, 3 Aug 2020 10:43:46 +0000 (18:43 +0800)
committerChun-wei Fan <fanchunwei@src.gnome.org>
Wed, 5 Aug 2020 08:23:14 +0000 (16:23 +0800)
By doing so, we ensure that resizes of windows will work on Vulkan renderer, by
first calling gdk_win32_surface_handle_queued_move_resize() before we proceed
as usual

gdk/win32/gdkvulkancontext-win32.c

index 607658dde9cceb00f988dd922553609597bb628c..e0d9ae84731cdd93cebaf659286cbf24523f6326 100644 (file)
@@ -72,12 +72,23 @@ gdk_win32_vulkan_context_create_surface (GdkVulkanContext *context,
   return result;
 }
 
+static void
+gdk_win32_vulkan_context_begin_frame (GdkDrawContext *draw_context,
+                                      cairo_region_t *update_area)
+{
+  gdk_win32_surface_handle_queued_move_resize (draw_context);
+
+  GDK_DRAW_CONTEXT_CLASS (gdk_win32_vulkan_context_parent_class)->begin_frame (draw_context, update_area);
+}
+
 static void
 gdk_win32_vulkan_context_class_init (GdkWin32VulkanContextClass *klass)
 {
   GdkVulkanContextClass *context_class = GDK_VULKAN_CONTEXT_CLASS (klass);
+  GdkDrawContextClass *draw_context_class = GDK_DRAW_CONTEXT_CLASS (klass);
 
   context_class->create_surface = gdk_win32_vulkan_context_create_surface;
+  draw_context_class->begin_frame = gdk_win32_vulkan_context_begin_frame;
 }
 
 static void